@echo off
chcp 65001 >nul
echo 开始整理项目文件...

REM 创建目录
if not exist docs mkdir docs
if not exist config mkdir config
if not exist tools mkdir tools
if not exist tests mkdir tests
if not exist scripts mkdir scripts
if not exist temp mkdir temp

echo.
echo 移动文档文件到 docs/...
move /Y "API_FORMAT_GUIDE.md" docs\ 2>nul
move /Y "APPLEDB_ISSUE.md" docs\ 2>nul
move /Y "FINAL_SUMMARY.md" docs\ 2>nul
move /Y "MULTI_DEVICE_GUIDE.md" docs\ 2>nul
move /Y "NOTIFICATION_RULES.md" docs\ 2>nul
move /Y "QUICK_FIX.md" docs\ 2>nul
move /Y "QUICKSTART.md" docs\ 2>nul
move /Y "TROUBLESHOOTING.md" docs\ 2>nul
move /Y "UPDATE_LOG.md" docs\ 2>nul
move /Y "README.md" docs\ 2>nul
move /Y "需求.md" docs\ 2>nul

echo 移动配置文件到 config/...
move /Y "config.multi_device_fixed.example" config\ 2>nul
move /Y "config.multi_device.example" config\ 2>nul
move /Y "CORRECT_CONFIG.txt" config\ 2>nul

echo 移动工具文件到 tools/...
move /Y "check_signing_status.py" tools\ 2>nul
move /Y "debug_parse.py" tools\ 2>nul
move /Y "device_name_mapping.py" tools\ 2>nul
move /Y "find_version.py" tools\ 2>nul

echo 移动测试文件到 tests/...
move /Y "test_api_formats.py" tests\ 2>nul
move /Y "test_appledb_url.py" tests\ 2>nul
move /Y "test_fallback_flow.py" tests\ 2>nul
move /Y "test_ios_api.py" tests\ 2>nul
move /Y "test_multi_device.py" tests\ 2>nul
move /Y "test_notify_logic.py" tests\ 2>nul
move /Y "test_with_html_format.py" tests\ 2>nul

echo 移动脚本文件到 scripts/...
move /Y "run_monitor.sh" scripts\ 2>nul
move /Y "firmware_monitor.service" scripts\ 2>nul

echo 移动临时文件到 temp/...
move /Y "iPhone-15-Pro-Max_page.html" temp\ 2>nul
move /Y "firmware_monitor.log" temp\ 2>nul

echo.
echo ================================
echo 文件整理完成！
echo ================================
echo.
echo 项目结构:
echo   firmware_monitor.py  - 主程序
echo   requirements.txt     - 依赖列表
echo   docs/               - 文档
echo   config/             - 配置示例
echo   tools/              - 辅助工具
echo   tests/              - 测试脚本
echo   scripts/            - 启动脚本
echo   temp/               - 临时文件
echo.
echo 下一步: 查看 PROJECT_STRUCTURE.md 了解详细结构
echo 快速开始: 查看 docs/START_HERE.md
pause

